package com.education.springbootdemo.mapper;

import com.education.springbootdemo.vo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectKey;

//@Mapper
public interface UserMapper {

    @Insert("INSERT INTO user (username, password,email, hobby, gender, phone) VALUES (#{username},#{password}, #{email},#{hobby},#{gender},#{phone})")
    Long insertUser(User user);

    User selectById(Long id);

    User selectByUsernameAndPassword(@Param("username") String username, @Param("password") String password);

    User selectByUsername(String username);

    //生成一个代理方法
    Long regUser(User user);
}
